<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Basic ValidateBox - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="easyui-1.4.4/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="easyui-1.4.4/themes/icon.css">
	<script src="easyui-1.4.4/jquery.min.js"></script>
	<script src="easyui-1.4.4/jquery.easyui.min.js"></script>
	<script src="./easyui_extension.js"></script>

</head>
<body>
	<h2>Basic ValidateBox</h2>
	<p>It's easy to add validate logic to a input box.</p>
	<div style="margin:20px 0;"></div>
    <form id="form">
	<div class="easyui-panel" title="Register" style="width:400px;padding:10px 60px 20px 60px">
		<table cellpadding="5">
            <tr>
				<td>Select:</td>
				<td>
                    <select class="easyui-combobox" name="sex" data-options="required:true" validType='valueRequired'>
                        <option value="" selected="selected">-- 请选择 --</option>
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>

                </td>
			</tr>
            <tr>
                <td>Birthday:</td>
                <td><input class="easyui-datebox textbox" data-options="required:true,validType:'valueRequired'"></td>
            </tr>
            <!--<tr>-->
				<!--<td>User Name:</td>-->
				<!--<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'length[3,10]'"></td>-->
			<!--</tr>-->
            <!--<tr>-->
				<!--<td>Email:</td>-->
				<!--<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'email'"></td>-->
			<!--</tr>-->
			<!--<tr>-->
				<!--<td>URL:</td>-->
				<!--<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'url'"></td>-->
			<!--</tr>-->
			<!--<tr>-->
				<!--<td>Phone:</td>-->
				<!--<td><input class="easyui-validatebox textbox" data-options="required:true" validType="mobile"></td>-->
			<!--</tr>-->
		</table>
		<button onclick="return validate()">提交</button>
	</div>
    </form>
	<script>

		function onSelect(param) {
			console.info("参数长度为: " + arguments.length);
			for (var item in arguments) {
				console.log(arguments[item]);
			}
		}
		function validate() {
			var re = $("#form").form('validate');
			if (re) {
				$.messager.show({title: '成功', msg: '成功', timeout: 2000, showType: 'slide'});
			} else {
				$.messager.show({title: '失败', msg: '失败', timeout: 2000, showType: 'slide'});
			}
			return re;
		}
	</script>
</body>
</html>